<?php

namespace app\job;
use think\queue\Job;
use app\service\ParsingXMLService;

class ParsingXML extends BaseJob
{
    protected ParsingXMLService $parsingXMLService;
    public function initialize()
    {
        $this->parsingXMLService = new ParsingXMLService();
    }

    public function fire(Job $job,$fileInfo) {
        echo "start",PHP_EOL;
        if ($job->attempts() > 3) {
            $job->delete();
        }
        $this->parsingXMLService->parsingXML($fileInfo);
        $job->delete();
        echo "end",PHP_EOL;
    }

}